package inventory.view;



import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.SpringLayout;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.SwingConstants;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import java.awt.Color;
import javax.swing.JRadioButton;
import javax.swing.JCheckBox;
import javax.swing.JList;
import javax.swing.AbstractListModel;
import javax.swing.border.LineBorder;

/*
 *  GUI
 */
public class InventoryDriver extends JFrame implements ActionListener {
	private JButton btnCategory;
	private JButton btnMaterial;
	
	public InventoryDriver() {
		SpringLayout springLayout = new SpringLayout();
		getContentPane().setLayout(springLayout);
		
		JSeparator separator = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator, -35, SpringLayout.SOUTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, separator, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator, -33, SpringLayout.SOUTH, getContentPane());
		getContentPane().add(separator);
		
		JSeparator separator_1 = new JSeparator();
		springLayout.putConstraint(SpringLayout.WEST, separator_1, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator_1, -10, SpringLayout.EAST, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator, 0, SpringLayout.EAST, separator_1);
		springLayout.putConstraint(SpringLayout.NORTH, separator_1, 76, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator_1, 78, SpringLayout.NORTH, getContentPane());
		getContentPane().add(separator_1);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		springLayout.putConstraint(SpringLayout.NORTH, tabbedPane, 8, SpringLayout.SOUTH, separator_1);
		springLayout.putConstraint(SpringLayout.WEST, tabbedPane, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, tabbedPane, -6, SpringLayout.NORTH, separator);
		springLayout.putConstraint(SpringLayout.EAST, tabbedPane, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(tabbedPane);
				
				JPanel panel_1 = new JPanel();
				tabbedPane.addTab("MASTER MANAGMENT", null, panel_1, null);
				SpringLayout sl_panel_1 = new SpringLayout();
				panel_1.setLayout(sl_panel_1);
				
				JSeparator separator_2 = new JSeparator();
				sl_panel_1.putConstraint(SpringLayout.NORTH, separator_2, 10, SpringLayout.NORTH, panel_1);
				sl_panel_1.putConstraint(SpringLayout.WEST, separator_2, 133, SpringLayout.WEST, panel_1);
				sl_panel_1.putConstraint(SpringLayout.SOUTH, separator_2, -10, SpringLayout.SOUTH, panel_1);
				sl_panel_1.putConstraint(SpringLayout.EAST, separator_2, 135, SpringLayout.WEST, panel_1);
				separator_2.setOrientation(SwingConstants.VERTICAL);
				
				panel_1.add(separator_2);
				
				btnCategory = new JButton("CATEGORY");
				sl_panel_1.putConstraint(SpringLayout.NORTH, btnCategory, 22, SpringLayout.NORTH, panel_1);
				sl_panel_1.putConstraint(SpringLayout.WEST, btnCategory, 10, SpringLayout.WEST, panel_1);
				panel_1.add(btnCategory);
				
				btnMaterial = new JButton("MATERIAL");
				sl_panel_1.putConstraint(SpringLayout.NORTH, btnMaterial, 117, SpringLayout.SOUTH, btnCategory);
				sl_panel_1.putConstraint(SpringLayout.EAST, btnMaterial, 0, SpringLayout.EAST, btnCategory);
				panel_1.add(btnMaterial);
				
				JPanel panel_5 = new JPanel();
				panel_5.setBackground(Color.WHITE);
				sl_panel_1.putConstraint(SpringLayout.NORTH, panel_5, 10, SpringLayout.NORTH, panel_1);
				sl_panel_1.putConstraint(SpringLayout.WEST, panel_5, 6, SpringLayout.EAST, separator_2);
				sl_panel_1.putConstraint(SpringLayout.SOUTH, panel_5, 0, SpringLayout.SOUTH, separator_2);
				sl_panel_1.putConstraint(SpringLayout.EAST, panel_5, -10,SpringLayout.EAST,panel_1);
				panel_1.add(panel_5);
		
				
				JPanel panel = new Inward();
				tabbedPane.addTab("INWARDS", null, panel, null);
				
		
		
		JPanel panel_2 = new Outward();
		tabbedPane.addTab("OUTWARD ENTRY", null, panel_2, null);
		
				
		
		
		JPanel panel_3 = new InventoryReport();
		tabbedPane.addTab("REPORTS", null, panel_3, null);
		
		JPanel panel_4 = new JPanel();
		tabbedPane.addTab("REVERTS", null, panel_4, null);
	}

	
	@Override
	public void actionPerformed(ActionEvent arg0) {
	
		
		
	}
}
